<?php

session_start();
/*require_once '../include/config.lib.php';
require_once '../include/database.lib.php';
*/

function getInfoByUsername($username){
	ConnectToDB();
	
}

function getInfo($personId){
	ConnectToDB();
	
	$info = array();
	$private = '-private';
	$info['NAME'] = $private;
	$info['EMAIL'] = $private;
	$info['AFFILIATION'] = $private;
	$info['DESCRIPTION'] = $private;
	$info['JOINDATE'] = $private;
	
	$stmt = DBExecute("SELECT EMAIL, NAME, AFFILIATION, JOINDATE, DESCRIPTION, SHOWNAME, SHOWAFFILIATION, SHOWJOINDATE, SHOWDESCRIPTION, SHOWFRIENDLIST, SHOWEMAIL from Person WHERE id = ?",$personId);
	if($row = $stmt->fetchAssocRow()){
		if($row['SHOWNAME'] == 'y')
			$info['NAME'] = $row['NAME'];
		if($row['SHOWEMAIL'] == 'y')
			$info['EMAIL'] = $row['EMAIL'];
		if($row['SHOWAFFILIATION'] == 'y')
			$info['AFFILIATION'] = $row['AFFILIATION'];
		if($row['SHOWDESCRIPTION'] == 'y')
			$info['DESCRIPTION'] = $row['DESCRIPTION'];
		if($row['SHOWJOINDATE'] == 'y')
			$info['JOINDATE'] = $row['JOINDATE'];
	}
	return $info;
}